package com.ohuang.test_koin.module

import com.ohuang.test_koin.MainViewModel
import com.ohuang.test_koin.presenter.UserPresenter
import com.ohuang.test_koin.presenter.UserPresenter2
import com.ohuang.test_koin.repository.LoginRepository
import com.ohuang.test_koin.repository.LoginRepositoryImpl
import com.ohuang.test_koin.repository.UserRepository
import com.ohuang.test_koin.repository.UserRepositoryImpl
import org.koin.androidx.compose.get
import org.koin.androidx.fragment.dsl.fragment
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.androidx.viewmodel.dsl.viewModelOf
import org.koin.core.context.startKoin
import org.koin.core.context.unloadKoinModules
import org.koin.core.module.dsl.singleOf
import org.koin.core.qualifier.named
import org.koin.core.qualifier.qualifier
import org.koin.dsl.bind
import org.koin.dsl.module

var appModule = module {
    singleOf (::UserRepositoryImpl) bind(UserRepository::class)

    factory { UserPresenter(get()) }
    single {  UserPresenter2(get()) }
    viewModel() { MainViewModel(get()) }
}

var loginModule= module {

    factory<LoginRepository> { LoginRepositoryImpl(mapOf("admin" to "admin","123" to "123")) }
}